package com.quickfile;

import java.io.IOException;
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;

public abstract class File implements Serializable, Comparable<File> {

	public static String pathSeparator = java.io.File.pathSeparator;
	public static char pathSeparatorChar = java.io.File.pathSeparatorChar;
	public static String separator = java.io.File.separator;
	public static char separatorChar = java.io.File.separatorChar;

	public static File newInstance(String pathname) {
		return FileSystemContext.fileSystemFactory.newFile(pathname);
	}

	public static File newInstance(String parent, String child) {
		return FileSystemContext.fileSystemFactory.newFile(parent, child);
	}

	public static File newInstance(File parent, String child) {
		return FileSystemContext.fileSystemFactory.newFile(parent, child);
	}

	private static File getTempFile() {
		return FileSystemContext.fileSystemFactory.newFile("");
	}

	public abstract boolean canRead();

	public abstract boolean canWrite();

	public abstract int compareTo(File pathname);

	public abstract boolean createNewFile() throws IOException;

	public static File createTempFile(String prefix, String suffix)
			throws IOException {
		return getTempFile().createTempFile2(prefix, suffix);
	}

	public abstract File createTempFile2(String prefix, String suffix)
			throws IOException;

	public static File createTempFile(String prefix, String suffix,
			File directory) throws IOException {
		return getTempFile().createTempFile2(prefix, suffix, directory);
	}

	public abstract File createTempFile2(String prefix, String suffix,
			File directory) throws IOException;

	public abstract boolean delete();

	public abstract void deleteOnExit();

	public abstract boolean equals(Object obj);

	public abstract boolean exists();

	public abstract File getAbsoluteFile();

	public abstract String getAbsolutePath();

	public abstract File getCanonicalFile() throws IOException;

	public abstract String getCanonicalPath() throws IOException;

	public abstract String getName();

	public abstract String getParent();

	public abstract File getParentFile();

	public abstract String getPath();

	public abstract int hashCode();

	public abstract boolean isAbsolute();

	public abstract boolean isDirectory();

	public abstract boolean isFile();

	public abstract boolean isHidden();

	public abstract long lastModified();

	public abstract long length();

	public abstract String[] list();

	public abstract String[] list(FilenameFilter filter);

	public abstract File[] listFiles();

	public abstract File[] listFiles(FileFilter filter);

	public abstract File[] listFiles(FilenameFilter filter);

	public static File[] listRoots() {
		return getTempFile().listRoots2();
	}

	public abstract File[] listRoots2();

	public abstract boolean mkdir();

	public abstract boolean mkdirs();

	public abstract boolean renameTo(File dest);

	public abstract boolean setLastModified(long time);

	public abstract boolean setReadOnly();

	public abstract String toString();

	public abstract URI toURI();

	public abstract URL toURL() throws MalformedURLException;
}
